package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenSetsimgsMapper;
import com.server.pinggu.domain.SenSetsimgs;
import com.server.pinggu.service.ISenSetsimgsService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenSetsimgsServiceImpl extends ServiceImpl<SenSetsimgsMapper, SenSetsimgs> implements ISenSetsimgsService {

    @Override
    public List<SenSetsimgs> queryList(SenSetsimgs senSetsimgs) {
        LambdaQueryWrapper<SenSetsimgs> lqw = Wrappers.lambdaQuery();
        if (senSetsimgs.getSid() != null){
            lqw.eq(SenSetsimgs::getSid ,senSetsimgs.getSid());
        }
        if (StringUtils.isNotBlank(senSetsimgs.getKeyword())){
            lqw.eq(SenSetsimgs::getKeyword ,senSetsimgs.getKeyword());
        }
        if (StringUtils.isNotBlank(senSetsimgs.getContent())){
            lqw.eq(SenSetsimgs::getContent ,senSetsimgs.getContent());
        }
        if (senSetsimgs.getType() != null){
            lqw.eq(SenSetsimgs::getType ,senSetsimgs.getType());
        }
        if (senSetsimgs.getHits() != null){
            lqw.eq(SenSetsimgs::getHits ,senSetsimgs.getHits());
        }
        return this.list(lqw);
    }
}